/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.ufba.lasid.virtualization.api;

import java.io.IOException;

/**
 *
 * @author aliriosa
 */
public interface IVirtualMachineHandler {

    public String getId();

    public void setId(String id);

    public String getName();

    public void setName(String name);

    /**
     * Create a virtual machine instance
     *
     * @throws Exception
     */
    public void create() throws Exception;

    /**
     * Destroy a virtual machine instance
     *
     * @throws Exception
     */
    public void destroy() throws Exception;

    /**
     * Pause a virtual machine instance
     *
     * @throws Exception
     */
    public void pause() throws Exception;

    /**
     * Unpause a virtual machine instance
     *
     * @throws Exception
     */
    public void unpause() throws Exception;

    /**
     * Create a checkpoint of a virtual machine instance (only current memory)
     *
     * @throws Exception
     */
    public void checkpoint() throws Exception;

    /**
     * Restore a checkpoint of a virtual machine instance (only current memory).
     * It must keep the instance in pause state.
     *
     * @throws Exception
     */
    public void restore() throws Exception;

    /**
     * Restore a checkpoint of a virtual machine instance (only current memory).
     *
     * @throws Exception
     */
    public void restoreAndRun() throws Exception;

    /**
     * Connect with a virtual machine instance.
     *
     * @throws Exception
     */
    public void connect(String vmid) throws Exception;

    /**
     * Get the status of a virtual machine instance
     *
     * @throws IOException
     */
    public void restoreStateById() throws IOException;
    
    public void restoreStateByName() throws IOException;

    public void restoreId() throws IOException;
}
